namespace cpputils
{

struct smart_file
{
public:
	explicit smart_file(FILE* V = 0);
	smart_file(const smart_file& V);
	smart_file(const string& Filename, const string& Mode);
	operator FILE*() const;
	smart_file& operator=(const smart_file& V);
	~smart_file();
	FILE* get() const;
	FILE* release() const;
	void reset(FILE* V = 0);
	void reset(const string& Filename, const string& Mode);

private:
	mutable FILE* Ptr;
};

}
